package com.example.register1.controller;

import com.example.register1.pojo.User;
import com.example.register1.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.HashMap;
import java.util.Map;

@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/register")
    public String register(){
        return "/register";
    }
    @PostMapping("/register")
    public String login(User user){
        userService.register(user);
        return "succes";
    }
}
